package cool.taomu.toolkit.entity

import org.eclipse.xtend.lib.annotations.Accessors
import org.eclipse.xtend.lib.annotations.ToString

@Accessors
@ToString
class CacheableConfigEntity {
    // 基础信息
    String host;
    int port;
    String username;
    String password;

    // 连接池大小相关
    int initialSize = 5;
    int minIdle = 5;
    int maxIdle = 20;
    int maxActive = 50;
    long maxWait = 10_000; // 单位：毫秒
    long validationInterval = 30_000;

    // 连接有效性检测
    boolean testWhileIdle = true;
    boolean testOnBorrow = false;
    boolean testOnReturn = false;
    boolean useValidationQuery = true;

    // 网络与安全
    String proxyHost;
    int proxyPort;
    boolean sslEnabled = false;
    String sslTrustStorePath;
    String sslTrustStorePassword;

    // 健康检查
    long healthCheckTimeout = 5_000; // 单位：毫秒

    // 连接池类型
    PoolType poolType = PoolType.REDIS;

    enum PoolType {
        REDIS
    }

}
